import React, {  Suspense } from 'react'
import { BrowserRouter, useRoutes } from 'react-router-dom'

const Pay = React.lazy(() => import('../views/pay'))
const PayResult = React.lazy(() => import('../views/payResult'))
const PayOrder = React.lazy(() => import('../views/payOrder'))


const Index = () => {
  const RouterView = () => useRoutes([
    {
      path: '/',
      element: <Pay></Pay>
    },
    {
      path: '/pay/result',
      element: <PayResult></PayResult>
    },
    {
      path: '/pay/order',
      element: <PayOrder></PayOrder>
    }
  ])
  return (
    <BrowserRouter>
      <Suspense>
        <RouterView></RouterView>
      </Suspense>
    </BrowserRouter>
  )
}


export default Index